package com.seecode.Database;


import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by Administrator on 2017/10/16.
 */

public class MyDataBaseHelper extends SQLiteOpenHelper {


    private Context mContext;
    private SQLiteDatabase readDb;
    private SQLiteDatabase writeDb;

    public MyDataBaseHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
        this.mContext = mContext;
        readDb = getReadableDatabase();
        writeDb= getWritableDatabase();



    }

//MyDataBaseHelper db = new MyDataBaseHelper(getcontext(),"store.db",1)

    @Override
    public void onCreate(SQLiteDatabase db) {
        //db.execSQL(CREATE_BOOK);
        //db.execSQL(CREATE_CATEGORY);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {


        onCreate(db);

    }
    public void exeSql(String  sql){

        writeDb.execSQL(sql);
    }


}
